{-# LANGUAGE TypeOperators #-}
{- |
Module      :  Segregate
Description :  <optional short text displayed on contents page>
Copyright   :  (c) Sergey Sichevskiy 2013
License     :  BSD3

Maintainer  :  s.sichevskij@gmal.com
Stability   :  experimental
Portability :  portable

Модель фотометрии

-}

module Model.Photometry
 ( ModelPhotometry(..)
 )
   where

import Types
import Data.HList
import Control.Applicative (liftA2, (<$>), (<*>))

-- Класс моделируемая фотометрия
class (Show a) => ModelPhotometry a where
  mag :: Factory (SED -> a)

instance (ModelPhotometry x, ModelPhotometry xs) => ModelPhotometry (x ::: xs) where
  mag = liftA2 (:::) <$> mag <*> mag

instance ModelPhotometry Null where
  mag = return $ const Null